#ifndef VIEWS_HPP
#define	VIEWS_HPP

#include "utilities.hpp"
#include "collections/LinkedList.cpp"
#include "collections/Queue.cpp"
#include "uniofwork.hpp"

using lms::utilities::Utilities;
using namespace lms::entities;
using namespace lms::unitofwork;

namespace lms {
    namespace views {

        class UserView {
        private:
            int option;
            string userName;
            string password;
            string fullName;
            User* user;
            void remove();
            void edit();
            void add();
            User* createUser();
            GenericRepository< User >* repository;

            void showUsers();

        public:

            UserView();
            void show();


        };

        class CustomerView {
        private:
            int option;
            string fullName;
            string address;
            string contactNumber;
            string email;
            Customer *customer;
            void remove();
            void edit();
            void add();
            Customer* createCustomer();

            CustomerServices* customerServices;

            void showCustomers();


        public:

            CustomerView();
            void show();
        };

        class BookView {
        private:
            int option;
            string title;
            string author;
            string isbn;
            string editor;
            string category;
            double price;
            Book *book;
            BookServices* bookServices;

            void remove();
            void edit();
            void add();
            Book* createBook();


            void showBooks();

        public:

            BookView();
            void show();


        };

        class OrderView {
        private:
            int option;
            int quantity;
            int productIndex;
            Queue<Customer>* customers;
            OrderServices* orderServices;
            BookServices* bookServices;
            void showOrdersDetail( LinkedList<OrderDetail>* orderDetails );
            void showBillInfo( Customer* customer );
            void init();
            Book* retrievedBook;
            
            void addBook();
            void cancelOrder();
            void removeBook();
            void checkOut();
            
        public:

            OrderView();
            OrderView( Queue<Customer>* customers );          
            void mainMenu();
            void show();
            void showBooks();
            void showActualOrder();
            void setCustomersEnQueue( Queue< Customer >* customers );
            void showAllOrders();
        };

        class MaintenancesView {
        private:

            BookView* book;
            UserView* user;
            CustomerView* customer;
            UnitOfWork* unitOfWork;
            int option;

        public:

            MaintenancesView();
            void show();

        };

        class MainView {
        private:

            int option;
            MaintenancesView *maintenance;
        public:

            MainView();
            void show();

        };

        class TurnView {

        private:
            Queue< Customer >* queueCustomer;
            CustomerServices* customerServices;
            int option;

            void createIfNotExist();
            void addCustomerToQueue();
            void listAll();

        public:
            TurnView();
            void show();
            Customer* attendCustomer();
            Queue< Customer >* getQueueCustomers();

       
        };
    }
}

#endif	/* VIEWS_HPP */

